﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using SOM.Common;
using SOM.ConcreteBL;
using SOM.Model;

public partial class Usuario_ConfirmaExclusaoUsuario : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnOk_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["Usuario"] == null)
            {
                FormsAuthentication.RedirectToLoginPage();
                return;
            }
                
           UsuarioBL usuarioBl = new UsuarioBL();

            bool confirmaExclusao = usuarioBl.Delete(Common.RetornarUsuarioSessao(this).usr_ds_nickname, txtSenha.Text);

            if (confirmaExclusao)
            {
                Session.Clear();
                FormsAuthentication.SignOut();
                Response.Redirect("~/Login.aspx");
            }
        }
        catch
        {

        }
    }
    protected void btnCancelar_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Usuario/CadastroUsuario.aspx?operacao=alteracao");
    }
}
